<h1>Lineage for <em><%= link_to @snippet.method_name, :controller => "view", :action => "snippet", :id => @snippet.id %></em> <small>v.<%= @snippet.version %></small></h1>

<div class="column">
<h2>Snippets <i>included by</i><br /><em><%= @snippet.method_name %></em> v.<%= @snippet.version %></h2>
<% if @includes.blank? %><p>None</p><% end %>
<% for result in @includes %>
	<div class="result snippets<% if (@includes.index(result)/2.0).i? %> odd<% end %>">
		<h3><em><%= link_to result.method_name, :controller => 'view', :action => 'snippet', :id => result.id %></em> v.<%= result.version %> <small>by <%= link_to result.user.login, :controller => 'view', :action => 'user', :id => result.user %> <span style="color:#ccd;"><%= result.created_on.to_date.to_s(:short) %></span></small></h3>
	</div>
<% end %>
<% unless @snippet.descendents.blank? %>
<h2>Snippets <i>based on</i><br /><em><%= @snippet.method_name %></em> v.<%= @snippet.version %></h2>
<div class="snippets">
<% if @snippet.descendents.blank? %><p>None</p><% end %>
<% for snippet in @snippet.descendents %>
	<div class="icon">
		<b><%= link_to truncate(snippet.method_name,16), :controller => 'view', :action => 'snippet', :id => snippet %></b> v.<%= snippet.version %><br />
		<p>by <%= link_to snippet.user.login, :controller => 'view', :action => 'user', :id => snippet.user %> <!-- <%= time_ago_in_words(snippet.created_on) %> ago --></p>
	</div>
<% end %>
</div>
<% end %>
</div>

<div class="column">
<h2>Snippets that <i>include</i><br /><em><%= @snippet.method_name %></em> v.<%= @snippet.version %></h2>
	<% if @includers.blank? %><p>None</p><% end %>
	<% for result in @includers %>
		<div class="result snippets<% if (@includers.index(result)/2.0).i? %> odd<% end %>">
			<h3><em><%= link_to result.method_name, :controller => 'view', :action => 'snippet', :id => result.id %></em> v.<%= result.version %> <small>by <%= link_to result.user.login, :controller => 'view', :action => 'user', :id => result.user %> (<%= result.total_use %> uses)</small></h3>
		</div>
	<% end %>	
</div>